﻿using NetTopologySuite.Geometries;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace housingsafety.server.Models
{
    public class BuildingDto
    {
        public string Id { get; set; }

        public string Bh { get; set; }

        public string Province { get; set; }

        public string City { get; set; }

        public string Xzqdm { get; set; }

        public string Town { get; set; }

        public string Village { get; set; }

        public string ProvinceAlias { get; set; }

        public string CityAlias { get; set; }

        public string XzqdmAlias { get; set; }

        public string TownAlias { get; set; }

        public string VillageAlias { get; set; }

        public string ZuQg { get; set; }

        public string LuQg { get; set; }

        public string HaoQg { get; set; }

        public string Address { get; set; }

        public long? Cs { get; set; }

        public string Fwbh { get; set; }

        public string Yhfwbh { get; set; }

        public string Geometry { get; set; }

        /// <summary>
        /// 住建排查状态(0-未排查,1-排查中,20-已排查无隐患,21-已排查有隐患,3不需要排查)
        /// </summary>
        public int? PcztHousing { get; set; }
        /// <summary>
        /// 消防排查状态(0-未排查,1-排查中,20-已排查无隐患,21-已排查有隐患,3不需要排查)
        /// </summary>
        public int? PcztFire { get; set; }
        /// <summary>
        /// 公安排查状态(0-未排查,1-排查中,20-已排查无隐患,21-已排查有隐患,3不需要排查)
        /// </summary>
        public int? PcztPolice { get; set; }

        /// <summary>
        /// 户主姓名
        /// </summary>
        public string Hzxm { get; set; }

        /// <summary>
        /// 级别
        /// </summary>
        public int? Level { get; set; }

        /// <summary>
        /// 住建(1-严重隐患;2-无隐患;3-一般隐患)
        /// </summary>
        public int? LevelHousing { get; set; } = 2;

        /// <summary>
        /// 消防(1-严重隐患;2-无隐患;3-一般隐患)
        /// </summary>
        public int? LevelFire { get; set; } = 2;

        /// <summary>
        /// 公安(1-严重隐患;2-无隐患;3-一般隐患)
        /// </summary>
        public int? LevelPolice { get; set; } = 2;

        /// <summary>
        /// 几何BoundingBox
        /// </summary>

        public double Lng { get; set; }
        public double Lat { get; set; }

        public DateTime? ModifiedOn { get; set; }

        public string Bz { get; set; }

        public double? Dcmj { get; set; }

        public string Mc { get; set; }

        public string BuildTime { get; set; }
    }

    public partial class CountClass
    {
        [Column("count")]
        public int Count { get; set; }

    }
    public partial class ZmPcYhLogCjDto
    {


        [Column("fwbh")]
        [StringLength(50)]
        public string? Fwbh { get; set; }


        [Column("hzxm")]
        [StringLength(255)]
        public string? Hzxm { get; set; }


        [Column("address")]
        public string? Address { get; set; }
    }


    public partial class ZmPcYhLogCjDto2
    {

        [Column("fwbh")]
        [StringLength(50)]
        public string? Fwbh { get; set; }

        [Column("hzxm")]
        [StringLength(255)]
        public string? Hzxm { get; set; }

        [Column("address")]
        public string? Address { get; set; }
    }


    public partial class ZmPcYhLogAllDto
    {

        [Key]
        [Column("id")]
        [StringLength(50)]
        public string Id { get; set; }

        [Column("fwbh")]
        [StringLength(50)]
        public string? Fwbh { get; set; }

        // 下面是第二个表的字段信息
        [Column("pczt")]
        public short? Pczt { get; set; }


        [Column("jcly")]
        public string? jcly { get; set; }

        [Column("create_on")]
        public DateTime CreateOn { get; set; }



        [Column("create_name")]
        public string CreateName { get; set; }



        [Column("jczt")]
        [StringLength(255)]
        public string? Jczt { get; set; }

        [Column("hzxm")]
        [StringLength(255)]
        public string? Hzxm { get; set; }
        [Column("yhly")]
        [StringLength(255)]
        public string? Yhly { get; set; }

        [Column("address")]
        public string? Address { get; set; }
    }


    public partial class ZmPcYhLogAllDto2
    {

        [Key]
        [Column("id")]
        [StringLength(50)]
        public string Id { get; set; }

        [Column("jcly")]
        public string jcly { get; set; }

        [Column("fwbh")]
        [StringLength(50)]
        public string? Fwbh { get; set; }

        // 下面是第二个表的字段信息
        [Column("pczt")]
        public string? Pczt { get; set; }
        [Column("jczt")]
        [StringLength(255)]
        public string? Jczt { get; set; }


        [Column("create_on")]
        public string CreateOn { get; set; }


        [Column("create_name")]
        public string CreateName { get; set; }

        [Column("hzxm")]
        [StringLength(255)]
        public string? Hzxm { get; set; }
        [Column("yhly")]
        [StringLength(255)]
        public string? Yhly { get; set; }

        [Column("address")]
        public string? Address { get; set; }
    }



    public partial class FwlbCount
    {
        [Column("yzc")]
        public int Yzc { get; set; }
        [Column("wzc")]
        public int Wzc { get; set; }

        [Column("yjc")]
        public int Yjc { get; set; }
        [Column("wjc")]
        public int Wjc { get; set; }

        [Column("count")]
        public int Count { get; set; }
    }

    public class MyHouseDto
    {

        public string szc { get; set; }

        public string fwbh { get; set; }

        public string hzxm { get; set; }

        public string address { get; set; }

        public int? fwzt { get; set; }
    }


    public class MyHouseDtoYJ
    {
        public string xzqdm { get; set; }

        public string xzq { get; set; }

        public string town { get; set; }

        public string towndm { get; set; }

        public string village { get; set; }

        public string villagedm { get; set; }

        public string fwbh { get; set; }

        public string address { get; set; }

        public string hzxm { get; set; }

        public string qj_jsrysstd { get; set; }


        public string qj_remark { get; set; }

        public int yhly { get; set; }

    }


    public class MyHouseDtoYJREsult
    {
        public string xzqdm { get; set; }

        public string xzq { get; set; }

        public string town { get; set; }

        public string towndm { get; set; }

        public string village { get; set; }

        public string villagedm { get; set; }

        public string fwbh { get; set; }

        public string address { get; set; }

        public string hzxm { get; set; }

        public string qj_jsrysstd { get; set; }

        public string sj_jsrysstd { get; set; }

        public string verification_discrepancy { get; set; }


    }

    public partial class FwlbDto
    {

        [Key]
        [Column("id")]
        [StringLength(50)]
        public string Id { get; set; }

        [Column("fwbh")]
        [StringLength(50)]
        public string? Fwbh { get; set; }

        // 下面是第二个表的字段信息
        [Column("pczt")]
        public short? Pczt { get; set; }

        // 下面是第二个表的字段信息
        [Column("geometry")]
        public string? Geometry { get; set; }


        [Column("villagelongitude")]
        public double? Villagelongitude { get; set; }
        [Column("villagelatitude")]
        public double? Villagelatitude { get; set; }

        [Column("zczt")]
        public short? Zczt { get; set; }

        [Column("jczt")]
        public short? Jczt { get; set; }

        [Column("feature")]
        public string? Feature { get; set; }

        [Column("hzxm")]
        [StringLength(255)]
        public string? Hzxm { get; set; }


        [Column("day_difference")]
        [StringLength(255)]
        public string? Daydifference { get; set; }


        [Column("address")]
        public string? Address { get; set; }

        [Column("jcsj")]
        public string? Jcsj { get; set; }

        [Column("zcsj")]
        public string? Zcsj { get; set; }


        [Column("hcsj")]
        public string? Hcsj { get; set; }


 
    }


    public partial class Fwlb_Fwzt
    {

        [Key]
        [Column("id")]
        [StringLength(50)]
        public string Id { get; set; }

        [Column("fwbh")]
        [StringLength(50)]
        public string? Fwbh { get; set; }

        // 下面是第二个表的字段信息
        [Column("pczt")]
        public short? Pczt { get; set; }

        // 下面是第二个表的字段信息
        [Column("geometry")]
        public string? Geometry { get; set; }


        [Column("villagelongitude")]
        public double? Villagelongitude { get; set; }
        [Column("villagelatitude")]
        public double? Villagelatitude { get; set; }

        [Column("zczt")]
        public short? Zczt { get; set; }

        [Column("jczt")]
        public short? Jczt { get; set; }

        [Column("feature")]
        public string? Feature { get; set; }

        [Column("hzxm")]
        [StringLength(255)]
        public string? Hzxm { get; set; }


        [Column("day_difference")]
        [StringLength(255)]
        public string? Daydifference { get; set; }


        [Column("address")]
        public string? Address { get; set; }

        [Column("jcsj")]
        public string? Jcsj { get; set; }

        [Column("zcsj")]
        public string? Zcsj { get; set; }


        [Column("hcsj")]
        public string? Hcsj { get; set; }


        [Column("fwzt")]
        public int? Fwzt { get; set; }
    }

    public class ZmPcYhLogDxDto : Repository.IEntity
    {
        [Key]
        [StringLength(50)]
        [Column("id")]
        public string Id { get; set; }

        [Column("check_name")]
        public string CheckName { get; set; }
        [Column("check_time")]

        public DateTime CheckTime { get; set; }

        [Column("check_by")]
        public string? CheckBy { get; set; }

        [Column("fwbh")]
        public string? Fwbh { get; set; }


        [Column("hzxm")]
        public string? hzxm { get; set; }

        [Column("address")]
        public string? Address { get; set; }

        [NotMapped]
        public DateTime CreateOn { get; set; }
        [NotMapped]
        public DateTime? ModifiedOn { get; set; }
        [NotMapped]
        public short? IsDelete { get; set; }
        [NotMapped]
        public DateTime? DeleteOn { get; set; }
    }

    public class ZmPcYhLogDxDto2
    {

        public string Id { get; set; }


        [Column("jcly")]
        public string? Jcly { get; set; }
        [StringLength(255)]
        [Column("check_name")]
        public string CheckName { get; set; }

        [Column("check_time")]

        public string CheckTime { get; set; }

        [Column("check_by")]
        public string? CheckBy { get; set; }
        [Column("fwbh")]
        public string? Fwbh { get; set; }


        [Column("hzxm")]
        public string? hzxm { get; set; }

        [Column("address")]
        public string? Address { get; set; }
    }

    public class Jcztnum
    {

        public int dzg { get; set; }

        public int dfh { get; set; }

        public int fhtg { get; set; }
    }

    public class ZmPcYhLogDxZgDto
    {

        public string Id { get; set; }

        [StringLength(255)]
        [Column("check_name")]
        public string CheckName { get; set; }



        [Column("hzxm")]
        public string? Hzxm { get; set; }


        [Column("address")]
        public string? Address { get; set; }

        [Column("zg_by")]
        public string? ZgBy { get; set; }


        [Column("zg_time")]
        public string? ZgTime { get; set; }


        [Column("fh_time")]
        public string? FhTime { get; set; }

        [Column("fh_by")]
        public string? FhBy { get; set; }

        [Column("fwbh")]
        public string? Fwbh { get; set; }
    }


    public class ZmPcYhLogDxDtoXq : Repository.IEntity
    {
        [Key]
        [Column("id")]
        public string Id { get; set; }


        [Column("zg_value")]
        public int? ZgValue { get; set; }


        [StringLength(255)]
        [Column("check_name")]
        public string CheckName { get; set; }

        [Column("check_id")]
        public string CheckId { get; set; }

        [Column("check_sm")]
        public string? CheckSm { get; set; }

        [Column("zg_ddc_num")]
        public int? ZgDdcNum { get; set; }

        [Column("zg_yhsyq_num")]
        public int? ZgYhsyqNum { get; set; }

        [Column("check_zp")]
        public string? CheckZp { get; set; }

        [Column("zg_zp")]
        public string? ZgZp { get; set; }
        [NotMapped]

        public string? IsHaveYh { get; set; }
        [NotMapped]
        public DateTime CreateOn { get; set; }
        [NotMapped]
        public DateTime? ModifiedOn { get; set; }
        [NotMapped]
        public short? IsDelete { get; set; }
        [NotMapped]
        public DateTime? DeleteOn { get; set; }
    }

    public class ZcJcYhDetail
    {

        public string Id { get; set; }


        public string? Fwbh { get; set; }



        public string CheckSm { get; set; }

        public string? Jcly { get; set; }

        public int? ZgValue { get; set; }


        public string CheckName { get; set; }

        public string CheckId { get; set; }

        public string? CheckZp { get; set; }
    }
    public class GdjsbtDto
    {
        public int xggdjsbpds { get; set; }
        public decimal azl { get; set; }
    }


    public class PieDto
    {
        public string name { get; set; }
        public decimal value { get; set; }
    }

    public class RysstdDto
    {
        public int zcount { get; set; }

        public int wdb { get; set; }

        public int ydb { get; set; }

        public decimal dbl { get; set; }
    }

    public class ZcJcZgYhDetail
    {

        public string Id { get; set; }


        public string? Fwbh { get; set; }

        public string? Jcly { get; set; }


        public string CheckSm { get; set; }


        public int? ZgValue { get; set; }


        public string CheckName { get; set; }

        public string CheckId { get; set; }

        public string? CheckZp { get; set; }

        public string? ZgYhsyqNum { get; set; }
        public string? ZgZp { get; set; }

        public string? ZgDdcNum { get; set; }
    }


    public class ZmPcYhLogDxZgDtoCj
    {
        [Key]
        [StringLength(50)]
        [Column("id")]
        public string Id { get; set; }

        [Column("fwbh")]
        public string Fwbh { get; set; }


        [StringLength(100)]
        [Column("check_id")]
        public string CheckId { get; set; }

        [StringLength(255)]
        [Column("check_name")]
        public string CheckName { get; set; }


        [Column("zg_zp", TypeName = "json")]
        public string? ZgZp { get; set; }

        [StringLength(50)]
        [Column("zg_time")]
        public string? ZgTime { get; set; }

        [StringLength(100)]
        [Column("zg_by")]
        public string? ZgBy { get; set; }

        [Column("fh_zt")]
        public int? FhZt { get; set; }

        [StringLength(2000)]
        [Column("fh_sm")]
        public string? FhSm { get; set; }

        [StringLength(100)]
        [Column("fh_time")]
        public string? FhTime { get; set; }

        [StringLength(100)]
        [Column("fh_by")]
        public string? FhBy { get; set; }

        [StringLength(255)]
        [Column("jczt")]
        public string? Jczt { get; set; }

        [Column("zg_ddc_num")]
        public int? ZgDdcNum { get; set; }

        [Column("zg_yhsyq_num")]
        public int? ZgYhsyqNum { get; set; }
    }

    public class ZmUserdto
    {
        public string Uname { get; set; }
        public string NickName { get; set; }

        public string Xzqdm { get; set; }

        public string Towndm { get; set; }

        public string Villagedm { get; set; }

        public string Xzq { get; set; }
        public string City { get; set; }

        public string Town { get; set; }

        public string Village { get; set; }

        public short? Roletype { get; set; }
    }

    public class ZmUserdto2
    {
        public string Uname { get; set; }
        public string NickName { get; set; }
        public string UnitName { get; set; }

        public string Xzqdm { get; set; }

        public string Towndm { get; set; }

        public string Villagedm { get; set; }

        public string Xzq { get; set; }
        public string Citydm { get; set; }
        public string City { get; set; }

        public string Town { get; set; }

        public string Village { get; set; }

        public short? Roletype { get; set; }
    }


    public class ZmBuildingsDto
    {
        [Column("id")]
        public string Id { get; set; }
        [Column("fwbh")]
        public string Fwbh { get; set; }
        [Column("hzxm")]
        public string Hzxm { get; set; }
        [Column("address")]
        public string Address { get; set; }


        [Column("xzqdm")]
        public string Xzqdm { get; set; }
        [Column("towndm")]

        public string Towndm { get; set; }

        [Column("villagedm")]
        public string Villagedm { get; set; }

        [NotMapped]
        public string XzqdmAlias { get; set; }
        [NotMapped]
        public string TownAlias { get; set; }
        [NotMapped]
        public string VillageAlias { get; set; }
    }

    public class BuildingGeomDto
    {
        public string Id { get; set; }

        public string Yhfwbh { get; set; }

        public string Fwbh { get; set; }

        public string Address { get; set; }

        /// <summary>
        /// 住建排查状态(0-未排查,1-排查中,20-已排查无隐患,21-已排查有隐患,3不需要排查)
        /// </summary>
        public int? PcztHousing { get; set; }
        /// <summary>
        /// 消防排查状态(0-未排查,1-排查中,20-已排查无隐患,21-已排查有隐患,3不需要排查)
        /// </summary>
        public int? PcztFire { get; set; }
        /// <summary>
        /// 公安排查状态(0-未排查,1-排查中,20-已排查无隐患,21-已排查有隐患,3不需要排查)
        /// </summary>
        public int? PcztPolice { get; set; }

        public string Geometry { get; set; }

        public double Lng { get; set; }

        public double Lat { get; set; }

        /// <summary>
        /// 几何BoundingBox
        /// </summary>
    }






    public class ZmBuildingFwzt
    {
       
        [Column("xzqdm")]
        public string Xzqdm { get; set; }
        [Column("towndm")]

        public string Towndm { get; set; }

        [Column("villagedm")]
        public string Villagedm { get; set; }


        [Column("fwbh")]
        public string Fwbh { get; set; }

        [Column("final_create_on")]
        public string FinalCreateOn { get; set; }


        [Column("final_fwzt")]
        public string FinalFwzt { get; set; }

        
    }
}

